﻿#include<iostream>

using namespace std;
class Date
{
public:
	// void Init(Date* const this, int year, int month, int day)
	void Init(int year, int month, int day)
	{
		_year = year;
		this->_month = month;
		this->_day = day;
	}
	//void Print(Date* const this)
	void Print()
	{
		//cout << this->_year << "/" << this->_month << "/" << this->_day << endl;
		cout << _year << "/" << _month << "/" << _day << endl;
	}
private:
	// 这⾥只是声明，没有开空间
	int _year;
	int _month;
	int _day;
};
int main()
{
	// Date类实例化出对象d1和d2
	Date d1;
	Date d2;

	// d1.Init(&d1, 2024, 3, 31);
	d1.Init(2024, 3, 31);
	d2.Init(2024, 7, 5);

	//d1.Print(&d1);
	d1.Print();

	//d2.Print(&d2);
	d2.Print();

	//const int* p1;
	//int* const p2; 必须初始化
	//p2指向的内容可以修改p2本身不能修改

	return 0;
}